import {
  sell
} from '@/api/sell'

export default {
  state: {
    userName: ''
  },
  mutations: {
    setAvator (state, avatorPath) {
      state.avatorImgPath = avatorPath
    }
  },
  getters: {
    messageUnreadCount: state => state.messageUnreadList.length
  },
  actions: {
    // 登录
    handleLogin ({ commit }, data) {
      return new Promise((resolve, reject) => {
        sell(data).then(res => {
          resolve()
        }).catch(err => {
          reject(err)
        })
      })
    }
  }
}
